
/*
 * MainForm.java
 *
 * Created on Dec 27, 2010, 4:17:00 PM
 */

package Graphic;

import Client.RequestI;
import Graphic.DataManager.Employee.InsertEmployee;
import Graphic.DataManager.CarPackage.EditCarPanel;
import Graphic.DataManager.CarPackage.NewCar;
import Graphic.DataManager.Employee.EditEmployee;
import Graphic.Secretary.DeleteReservation;
import Graphic.Secretary.EditRoute;
import Graphic.Secretary.MakeReservation;
import Graphic.Secretary.NewCustomer;
import Graphic.Secretary.RemoveCustomer;
import Graphic.Secretary.Reports.MonthReportQ;
import Graphic.Secretary.Reports.RouteReportAnswer;
import Graphic.Secretary.Reports.RouteReportQ;
import XMLPack.Request;
import java.awt.CardLayout;
import javax.swing.JPanel;

public class MainForm extends javax.swing.JFrame {

    /** Creates new form MainForm */
    private RequestI request = null;
    private String user = null;
    private AccesLevel accesLevel = AccesLevel.getInstance();
    //panel-uri
    private NewCar newCar = null;    
    private InsertEmployee insertEmployee = null;
    private EditCarPanel editCar = null;
    private  LoginDialog login = null;
    private MakeReservation reservation = null;
    private RouteReportQ routeReport = null;
    private RouteReportAnswer routeReportAnswer = null;
    private DeleteReservation deleteReservation = null;
    private EditRoute editRoute = null;
    private NewCustomer newCustomer = null;
    private RemoveCustomer customer = null;
    private EditEmployee editEmployee = null;
    private MonthReportQ monthReportq = null;
    private ReguestPanel intampinare = null;

    public MainForm() {
        initComponents();
        myInit();
    }

    private void myInit()
    {
        request = new Request(this, "127.0.0.1", 8005, "localTemp.xml");

        login = new LoginDialog(this, true, request);
        login.setVisible(true);

        while (login.isVisible() == true);

        if (login.isVisible() == false){
            System.out.println("Am ajuns mainForm my inti ::: _____________");
            this.setVisible(true);
            login.setVisible(false);
            user = accesLevel.getName();
            userLabel.setText("Hello, "+ user+"!");
            setOptions();

        }
        System.out.println(accesLevel.isDataManager()+"request"+request);
        intampinare = new ReguestPanel();
        insertEmployee = new InsertEmployee(request);
        //carP = new CarP(request);
        newCar = new NewCar(request);
        editCar = new EditCarPanel(request, this);
        reservation = new MakeReservation(request);
        routeReport = new RouteReportQ(this,request);
        routeReportAnswer = new RouteReportAnswer(request);
        deleteReservation = new DeleteReservation(request);
        editRoute = new EditRoute(request);
        customer = new RemoveCustomer(request);
        newCustomer = new NewCustomer(request);
        editEmployee = new EditEmployee(request);
        monthReportq = new MonthReportQ(this, request);

        panel.setLayout(new CardLayout());
        panel.add(intampinare, "intampinare");
        panel.add(newCar, "newCar");
        panel.add(editCar, "editCar");
        panel.add(insertEmployee, "insertEmployee");
        panel.add(reservation, "makeReservation");
        panel.add(routeReport, "routeReport");
        panel.add(routeReportAnswer, "routeReportAnswer");
        panel.add(deleteReservation, "deleteReservation");
        panel.add(editRoute, "editRoute");
        panel.add(customer, "customer");
        panel.add(newCustomer, "newCustomer");
        panel.add(editEmployee, "editEmployee");
        panel.add(monthReportq, "monthReportq");

        
      
    }
    public RequestI getRequest() {return request;}
    public EditCarPanel getEditCarPanel(){return editCar;}
    public LoginDialog getLoginDialog(){return login;}
    public AccesLevel getAccesLevel(){return accesLevel;}
    public NewCar getNewCar(){return newCar;}
    public void setAccesLevel(AccesLevel l ){accesLevel = l;}
    public JPanel getPanel(){return panel;}
    public MakeReservation getReservation(){return reservation;}
    public RouteReportAnswer getRouteReportAnswer(){return routeReportAnswer;}
    public RemoveCustomer getCustomer(){return customer;}
    public EditEmployee getEditEmployee(){return editEmployee;}

    public void setOptions(){
        if(accesLevel.isDataManager()){
            jButton5.setEnabled(true);
            jButton4.setEnabled(true);
            jMenu3.setEnabled(true);
            jMenu7.setEnabled(true);
            Employee.setEnabled(true);
            jButton1.setEnabled(true);

        }
         if(accesLevel.isSecretary()){

            jButton2.setEnabled(true);
            jButton3.setEnabled(true);
            jMenu5.setEnabled(true);
            jButton1.setEnabled(true);

        }
        if(accesLevel.isAccountant()){
            jButton3.setEnabled(true);
            jMenu6.setEnabled(true);
        }
        if(accesLevel.isNone()){
            jButton1.setEnabled(true);
            jButton5.setEnabled(true);
            jButton4.setEnabled(true);
            jMenu3.setEnabled(true);
            jMenu7.setEnabled(true);
            Employee.setEnabled(true);
            jButton2.setEnabled(true);
            jMenu5.setEnabled(true);
            jButton3.setEnabled(true);
            jMenu6.setEnabled(true);
        }

    }
    public void modifyCar(String carNumber)
    {
         CardLayout cl = (CardLayout)(panel.getLayout());
         cl.show(panel, "newCar");
         newCar.insertCarLabel.setText("Modify Car");
         newCar.insertCarBtn.setText("Update car");

         String name = request.selectCar("dmstc", carNumber);
         request.getClient().SetRequest(name);




    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jDialog1 = new javax.swing.JDialog();
        jProgressBar1 = new javax.swing.JProgressBar();
        jPanel1 = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        userLabel = new javax.swing.JLabel();
        panel = new javax.swing.JPanel();
        jSeparator1 = new javax.swing.JSeparator();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu3 = new javax.swing.JMenu();
        menuItemNewCar = new javax.swing.JMenuItem();
        menuItemCarEdit = new javax.swing.JMenuItem();
        jMenu5 = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenu6 = new javax.swing.JMenu();
        menuItemRouteReport = new javax.swing.JMenuItem();
        jMenuItem8 = new javax.swing.JMenuItem();
        jMenu7 = new javax.swing.JMenu();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenuItem6 = new javax.swing.JMenuItem();
        Employee = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem7 = new javax.swing.JMenuItem();

        javax.swing.GroupLayout jDialog1Layout = new javax.swing.GroupLayout(jDialog1.getContentPane());
        jDialog1.getContentPane().setLayout(jDialog1Layout);
        jDialog1Layout.setHorizontalGroup(
            jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        jDialog1Layout.setVerticalGroup(
            jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("DMSTC ");

        jButton1.setText("Edit Route");
        jButton1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jButton1.setEnabled(false);
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Make reservation");
        jButton2.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jButton2.setEnabled(false);
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("Route Report");
        jButton3.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jButton3.setEnabled(false);
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setText("New Car");
        jButton4.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jButton4.setEnabled(false);
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jButton5.setText("New Employee");
        jButton5.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jButton5.setEnabled(false);
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE)
                        .addContainerGap())
                    .addComponent(userLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE)))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(userLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(152, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout panelLayout = new javax.swing.GroupLayout(panel);
        panel.setLayout(panelLayout);
        panelLayout.setHorizontalGroup(
            panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 563, Short.MAX_VALUE)
        );
        panelLayout.setVerticalGroup(
            panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 401, Short.MAX_VALUE)
        );

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);

        jMenu3.setText("Car");
        jMenu3.setEnabled(false);
        jMenu3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newCar(evt);
            }
        });

        menuItemNewCar.setText("New Car");
        menuItemNewCar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newCar(evt);
            }
        });
        jMenu3.add(menuItemNewCar);

        menuItemCarEdit.setText("Edit Cars ");
        menuItemCarEdit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editCar(evt);
            }
        });
        jMenu3.add(menuItemCarEdit);

        jMenuBar1.add(jMenu3);

        jMenu5.setText("Reservation");
        jMenu5.setEnabled(false);

        jMenuItem2.setText("Make Reservation");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                makeReservation(evt);
            }
        });
        jMenu5.add(jMenuItem2);

        jMenuItem3.setText("Delete Reservation ");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteReservation(evt);
            }
        });
        jMenu5.add(jMenuItem3);

        jMenuItem4.setText("Edit Route");
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editRoute(evt);
            }
        });
        jMenu5.add(jMenuItem4);

        jMenuBar1.add(jMenu5);

        jMenu6.setText("Reports");
        jMenu6.setEnabled(false);

        menuItemRouteReport.setText("Route Report");
        menuItemRouteReport.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                routeReport(evt);
            }
        });
        jMenu6.add(menuItemRouteReport);

        jMenuItem8.setText("Month Report");
        jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                monthReport(evt);
            }
        });
        jMenu6.add(jMenuItem8);

        jMenuBar1.add(jMenu6);

        jMenu7.setText("Customers");
        jMenu7.setEnabled(false);

        jMenuItem5.setText("New Customer");
        jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newCustomer(evt);
            }
        });
        jMenu7.add(jMenuItem5);

        jMenuItem6.setText("Remove customer");
        jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                customer(evt);
            }
        });
        jMenu7.add(jMenuItem6);

        jMenuBar1.add(jMenu7);

        Employee.setText("Employee");
        Employee.setEnabled(false);

        jMenuItem1.setText("Add employee");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newEmployee(evt);
            }
        });
        Employee.add(jMenuItem1);

        jMenuItem7.setText("Edit employee");
        jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editEmployees(evt);
            }
        });
        Employee.add(jMenuItem7);

        jMenuBar1.add(Employee);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 722, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(4, 4, 4)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 401, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed

         CardLayout cl = (CardLayout)(panel.getLayout());
         cl.show(panel, "newCar");
         newCar.setNew();

    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
         CardLayout cl = (CardLayout)(panel.getLayout());
         cl.show(panel, "editRoute");
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
          CardLayout cl = (CardLayout)(panel.getLayout());
            cl.show(panel, "insertEmployee");
    }//GEN-LAST:event_jButton5ActionPerformed

    private void newCar(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newCar
         CardLayout cl = (CardLayout)(panel.getLayout());
         cl.show(panel, "newCar");
         newCar.setNew();
    }//GEN-LAST:event_newCar

    private void editCar(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editCar

        CardLayout cl = (CardLayout)(panel.getLayout());
        cl.show(panel, "editCar");
        editCar.Show();
    }//GEN-LAST:event_editCar

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        CardLayout cl = (CardLayout)(panel.getLayout());
        cl.show(panel, "makeReservation");
        reservation.ResetCombo();
    }//GEN-LAST:event_jButton2ActionPerformed

    private void newEmployee(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newEmployee
       CardLayout cl = (CardLayout)(panel.getLayout());
            cl.show(panel, "insertEmployee");
    }//GEN-LAST:event_newEmployee

    private void makeReservation(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_makeReservation
        CardLayout cl = (CardLayout)(panel.getLayout());
        cl.show(panel, "makeReservation");
        reservation.ResetCombo();
        // request.citiesList("dmstc");
         //request.getClient().SetRequest("localTemp.xml");

    }//GEN-LAST:event_makeReservation

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
         CardLayout cl = (CardLayout)(panel.getLayout());
         cl.show(panel, "routeReport");
    }//GEN-LAST:event_jButton3ActionPerformed

    private void routeReport(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_routeReport
         CardLayout cl = (CardLayout)(panel.getLayout());
         cl.show(panel, "routeReport");
    }//GEN-LAST:event_routeReport

    private void deleteReservation(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteReservation
         CardLayout cl = (CardLayout)(panel.getLayout());
         cl.show(panel, "deleteReservation");
    }//GEN-LAST:event_deleteReservation

    private void editRoute(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editRoute
         CardLayout cl = (CardLayout)(panel.getLayout());
         cl.show(panel, "editRoute");
    }//GEN-LAST:event_editRoute

    private void customer(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_customer
       CardLayout cl = (CardLayout)(panel.getLayout());
         cl.show(panel, "customer");
         customer.Show();
    }//GEN-LAST:event_customer

    private void newCustomer(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newCustomer
        CardLayout cl = (CardLayout)(panel.getLayout());
         cl.show(panel, "newCustomer");
    }//GEN-LAST:event_newCustomer

    private void editEmployees(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editEmployees
         CardLayout cl = (CardLayout)(panel.getLayout());
         cl.show(panel, "editEmployee");
         editEmployee.Show();
    }//GEN-LAST:event_editEmployees

    private void monthReport(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_monthReport
        CardLayout cl = (CardLayout)(panel.getLayout());
         cl.show(panel, "monthReportq");
    }//GEN-LAST:event_monthReport

    
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MainForm(); //.setVisible(true);

            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu Employee;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JDialog jDialog1;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenu jMenu6;
    private javax.swing.JMenu jMenu7;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JMenuItem menuItemCarEdit;
    private javax.swing.JMenuItem menuItemNewCar;
    private javax.swing.JMenuItem menuItemRouteReport;
    private javax.swing.JPanel panel;
    private javax.swing.JLabel userLabel;
    // End of variables declaration//GEN-END:variables

    public void setRouteReportAnswer() {
        CardLayout cl = (CardLayout)(panel.getLayout());
        cl.show(panel, "routeReportAnswer");
        routeReportAnswer.Show();
    }

}
